package com.growthgate.bootcommon.amqp.sender;

import com.growthgate.bootcommon.config.RabbitMqConfig;
import com.growthgate.bootcommon.entity.User;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * TopicSender
 *
 * @author GrowthGate
 * @date 2019/10/28
 */
@Component
public class TopicSender {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void send(User user) {
        rabbitTemplate.convertAndSend(RabbitMqConfig.TOPIC_EXCHANGE, "lzc.message", user);
        rabbitTemplate.convertAndSend(RabbitMqConfig.TOPIC_EXCHANGE, "lzc.lzc", user);
    }

}